package com.qimu.saiyou.model.vo;

import com.qimu.saiyou.model.entity.CompeteExam;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author: FeiXiang
 * @Date: 2024年03月01日 21:36
 * @Version: 1.0
 * @Description:
 */
@Data
public class CompeteExamVO {
    private Long id;

    /**
     * 考试名称
     */
    private String examName;

    /**
     * 试卷ID
     */
    private Long paperId;

    /**
     * 比赛id
     */
    private String state;
    /**
     * 考试描述
     */
    private String description;

    /**
     * 总分数
     */
    private Long totalScore;

    /**
     * 总时长（分钟）
     */
    private Long totalTime;

    /**
     * 及格分数
     */
    private Long qualifyScore;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 包装类转对象
     *
     * @param competeExamVO 问答
     * @return {@link QuestionAnswerVO}
     */
    public static CompeteExam voToObj(CompeteExamVO competeExamVO) {
        if (competeExamVO == null) {
            return null;
        }
        CompeteExam competeExam = new CompeteExam();
        BeanUtils.copyProperties(competeExamVO, competeExam);
        return competeExam;
    }

    /**
     * 对象转包装类
     *
     * @return
     */
    public static CompeteExamVO objToVo(CompeteExam competeExam) {
        if (competeExam == null) {
            return null;
        }
        CompeteExamVO competeExamVO= new CompeteExamVO();
        BeanUtils.copyProperties(competeExam, competeExamVO);
        return competeExamVO;
    }
}
